/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cifreromane;

/**
 *
 * @author skipy
 */
public class Context {

    private int val_final, ultim_parcurs, suma_ultim,caracter_descifrat;

    public int getSuma_ultim() {
        return suma_ultim;
    }

    public void setSuma_ultim(int suma_ultim) {
        this.suma_ultim = suma_ultim;
    }

    public int getUltim_parcurs() {
        return ultim_parcurs;
    }

    public void setUltim_parcurs(int ultim_parcurs) {
        this.ultim_parcurs = ultim_parcurs;
    }

    public int getVal_final() {
        return val_final;
    }

    public void setVal_final(int val_final) {
        this.val_final = val_final;
    }

    public Context() {
        this.val_final = 0;
        this.ultim_parcurs = 0;
        this.suma_ultim = 0;
    }
    public int returneazaFinal()
    {
    return val_final;
    }
    public void actualizare(int a)
    {
        if(caracter_descifrat<ultim_parcurs)
        {
        val_final+=suma_ultim;
        suma_ultim++;
        ultim_parcurs++;
        }
        if(caracter_descifrat==ultim_parcurs)
        {
        suma_ultim+=ultim_parcurs;    
        }
        if(caracter_descifrat>ultim_parcurs)
        {
         val_final-=suma_ultim;
         suma_ultim++;
         ultim_parcurs++;
        }   
    }
}
